//
//  MenuTuiJianChangjingCollectionViewCell.m
//  Products_B
//
//  Created by lanou on 16/6/2.
//  Copyright © 2016年 朋学友. All rights reserved.
//

#import "MenuTuiJianChangjingCollectionViewCell.h"

@implementation MenuTuiJianChangjingCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.picImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, kWidth/3-1, 150)];
        self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 110, kWidth/3 - 20, 20)];
        self.countLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 130, kWidth/3 - 20, 20)];
        self.titleLabel.font = [UIFont systemFontOfSize:14];
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        self.countLabel.font = [UIFont systemFontOfSize:13];
        self.countLabel.textColor = [UIColor grayColor];
        self.countLabel.textAlignment = NSTextAlignmentCenter;
        self.picImageView.backgroundColor = [UIColor magentaColor];
        [self.picImageView addSubview:_titleLabel];
        [self.picImageView addSubview:_countLabel];
        [self.contentView addSubview:_picImageView];
      ;
    }
    return self;
}

- (void)setModel:(MenuTuiJianChangJingModel *)model{
    NSLog(@"%@  %@  ",model.dish_count,model.scene_title);
    _model = model;
    [self.picImageView sd_setImageWithURL:[NSURL URLWithString:model.scene_background] placeholderImage:nil completed:nil];
    self.titleLabel.text = model.scene_title;
    self.countLabel.text = [NSString stringWithFormat:@"%@道菜",model.dish_count];
}
@end
